package com.crm.jpaandthymeleaf.entity;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Objects;

/**
 * @author 周敬
 * @version 1.0
 * @packageName com.crm.jpaandthymeleaf.entity
 * @fileName OrdersLine
 * @createTime 2021/12/15-20:19-星期三
 * @lastModify 2021/12/15-20:19-星期三
 */
@Entity
@Table(name = "orders_line", schema = "crm", catalog = "")
public class OrdersLine {
    private long oddId;
    private long oddOrderId;
    private long oddProdId;
    private int oddCount;
    private String oddUnit;
    private BigDecimal oddPrice;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "odd_id")
    public long getOddId() {
        return oddId;
    }

    public void setOddId(long oddId) {
        this.oddId = oddId;
    }

    @Basic
    @Column(name = "odd_order_id")
    public long getOddOrderId() {
        return oddOrderId;
    }

    public void setOddOrderId(long oddOrderId) {
        this.oddOrderId = oddOrderId;
    }

    @Basic
    @Column(name = "odd_prod_id")
    public long getOddProdId() {
        return oddProdId;
    }

    public void setOddProdId(long oddProdId) {
        this.oddProdId = oddProdId;
    }

    @Basic
    @Column(name = "odd_count")
    public int getOddCount() {
        return oddCount;
    }

    public void setOddCount(int oddCount) {
        this.oddCount = oddCount;
    }

    @Basic
    @Column(name = "odd_unit")
    public String getOddUnit() {
        return oddUnit;
    }

    public void setOddUnit(String oddUnit) {
        this.oddUnit = oddUnit;
    }

    @Basic
    @Column(name = "odd_price")
    public BigDecimal getOddPrice() {
        return oddPrice;
    }

    public void setOddPrice(BigDecimal oddPrice) {
        this.oddPrice = oddPrice;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        OrdersLine that = (OrdersLine) o;
        return oddId == that.oddId && oddOrderId == that.oddOrderId && oddProdId == that.oddProdId && oddCount == that.oddCount && Objects.equals(oddUnit, that.oddUnit) && Objects.equals(oddPrice, that.oddPrice);
    }

    @Override
    public int hashCode() {
        return Objects.hash(oddId, oddOrderId, oddProdId, oddCount, oddUnit, oddPrice);
    }
}
